<template>
  <div class="loading" v-if="mainStore.isShowLoading">
    <div class="bg">
      <img src="@/assets/img/home/full-screen-loading.gif" alt="">
    </div>
  </div>
</template>

<script setup>
  import useMainStore from '@/stores/modules/main'

  const mainStore = useMainStore()
</script>

<style lang="less" scoped>
  .loading {
    position: fixed;
    right: 0;
    left: 0;
    bottom: 0;
    top: 0;
    z-index: 999;
    display: flex;
    justify-content: center;
    align-items: center;

    .bg {
      width: 104px;
      height: 104px;
      background: url(@/assets/img/home/loading-bg.png) 0 0 / 100% 100%;
      display: flex;
      justify-content: center;
      align-items: center;

      img {
        width: 70px;
        height: 70px;
        margin-bottom: 12px;
      }
    }
  }
</style>
